package cn.edu.scau.cmi.yangzhichao.adapter;

import javafx.fxml.FXML;
import javafx.scene.control.TextArea;

/**
 * Created by lfhr on 2019/4/5.
 */
public class AdapterViewController {
    @FXML
    private TextArea textArea;
    @FXML
    private void initialize(){

    }
    @FXML
    public void handleClass(){
        MobilePhone phone=new MobilePhone();
        String s=phone.charging(new AdapterOfClass());
        textArea.setText("AdapterOfClass:"+s);
    }
    @FXML
    public void handleObject(){
        MobilePhone phone=new MobilePhone();
        AdapterOfObject object=new AdapterOfObject(new Voltage220());
        String s= phone.charging(object);
        textArea.setText("AdapterOfObject:"+s);
    }
}
